]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
shellDBus: Use floats instead of percentages for OSD levels
authorJonas Dreßler <verdre@v0yd.nl>
Sat, 27 Jul 2019 17:29:36 +0000 (19:29 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 28 Jul 2019 15:27:53 +0000 (17:27 +0200)
Due to typecasting being done when converting floats to integers in
gnome-settings-daemon, a volume of 0.9% in g-s-d will end up as 0% in
gnome-shell. This can lead to a mismatch of icons between the volume OSD
(the icon to use is determined by g-s-d itself) and the shells own
volume indicator (the icon to use is determined by the shell using the
volume received from g-s-d).

To fix this, simply get rid of the conversion from float to percentage
in g-s-d and back to floats in the shell and just send a float/double
value on DBus.

https://gitlab.gnome.org/GNOME/gnome-settings-daemon/merge_requests/78
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/385

js/ui/shellDBus.js

index a287a3fb67073db37d27131ee0add64b77d43024..e750c207f9a103b19af68e9cfaf3351daa255455 100644 (file)
@@ -94,12 +94,6 @@ var GnomeShell = class {
         if (serializedIcon)
             icon = Gio.Icon.new_for_string(serializedIcon);
 
-        // Translate from percentages in the D-Bus API to floats
-        if (!isNaN(level))
-            level /= 100;
-        if (!isNaN(maxLevel))
-            maxLevel /= 100;
-
         Main.osdWindowManager.show(monitorIndex, icon, label, level, maxLevel);
     }